package com.atguigu.springcloud.order.controller;

import com.atguigu.springcloud.framework.common.api.ApiResult;
import com.atguigu.springcloud.order.service.PaymentFeignService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author lenovo
 * @version 1.0
 * @date 2020/11/12 9:58
 */
@RestController
@Slf4j
@RequestMapping("consumer")
public class OrderFeignController {

    @Autowired
    private PaymentFeignService paymentFeignService;

    @GetMapping("/payment/get/{id}")
    public ApiResult getPayment(@PathVariable Long id) {
        return paymentFeignService.getPaymentById(id);
    }

    @GetMapping("payment/feign/timeout")
    public String timeout(){
        return paymentFeignService.timeout();
    }

}
